# Contributor: TBK <alpine@jjtc.eu>
# Maintainer: TBK <alpine@jjtc.eu>
pkgname=fusee-nano
pkgver=0.4
pkgrel=0
pkgdesc="A minimalist re-implementation of the Fusée Gelée exploit, designed to run on embedded Linux devices."
url="https://github.com/DavidBuchanan314/fusee-nano"
arch="all"
license="MIT"
options="!check" # No test suite
makedepends="linux-headers"
subpackages="$pkgname-udev::noarch"
source="$pkgname-$pkgver.tar.gz::https://github.com/DavidBuchanan314/fusee-nano/archive/$pkgver.tar.gz"

build() {
    make
}

package() {
    mkdir -p "$pkgdir"/usr/share/$pkgname/
    cp -r files/* "$pkgdir"/usr/share/$pkgname/
    install -Dm 755 fusee-nano "$pkgdir"/usr/bin/fusee-nano

    # Remove openwrt file
    rm "$pkgdir"/usr/share/$pkgname/20-tegra_rcm
}

udev() {
    pkgdesc="udev rule for $pkgname"
    install_if="$pkgname=$pkgver-r$pkgrel eudev"
    mkdir -p "$subpkgdir"/lib/udev/rules.d/
    mv "$pkgdir"/usr/share/$pkgname/*.rules \
        "$subpkgdir"/lib/udev/rules.d/
}

sha512sums="18fe586a111a9bc8dd9c6ff57002ac731843c83151bfe2d63dd8890305862a7a93a9737256405dbc1c76f5a3fab94475fa786135c55d712e26600d04e0c26450  fusee-nano-0.4.tar.gz"
